<!DOCTYPE html>
<html lang="zh-CN" >
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
	<title>想即做thinkTodo任务清单</title>

<link rel="shortcut icon" href="/favicon.ico"/>
<link rel="bookmark" href="/favicon.ico"/>
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">

<link href="/libs/font-awesome-4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="/_assets/css/fonts.css">


<!--
本地 Bootstrap 核心 CSS 文件
本地jQuery文件。务必在bootstrap.min.js 之前引入
本地 Bootstrap 核心 JavaScript 文件 
-->
    
<link rel="stylesheet" href="/libs/bootstrap-3.3.5-dist/css/bootstrap.min.css">
<script src="/libs/jquery/jquery-1.11.3.min.js"></script>
<script src="/libs/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>


 <!--
 <link rel="stylesheet" href="/libs/jquery-ui/themes/base/jquery.ui.all.css">     
<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
-->      
    <!-- Add IntroJs styles -->
    <link href="/libs/introjs/introjs.css" rel="stylesheet"> 
      

<link rel="stylesheet" href="/_assets/css/base.css" >
<link rel="stylesheet" href="/_assets/css/home_with_bs.css" >
<link rel="stylesheet" href="/_assets/css/task_with_bs.css" >
<link rel="stylesheet" href="/_assets/css/style_tags.css" >
<style>
 
</style>
      
<link href='/libs/fullcalendar-1.6.1/fullcalendar/fullcalendar.css' rel='stylesheet' />
<link href='/libs/fullcalendar-1.6.1/fullcalendar/fullcalendar.print.css' rel='stylesheet' media='print' />

<script src='/libs/fullcalendar-1.6.1/jquery/jquery-1.9.1.min.js'></script>
<script src="/libs/layer/layer.js"></script>	


 <script type="text/javascript"> 
	var workarea='';
	var node_type_icon = new Object();
	node_type_icon["S"] ="fa-search";
	node_type_icon["undefined"] ="";
	domain="www.thinktodo.cn";

	
	var drag_type="task";
	var calendar_show=true;
	var current_edit_taskid;
	var current_opt_task_id;
	var current_opt_dom_id;
	var unique_dom_id=1000;//用于生成唯一dom id的起始序号
	var anchor_taskid;
	


	 
function refresh_node_and_append(){
		var url;
		var str;
		var rootTaskId = $("#parm").attr("data-rootTaskId");
		if(!rootTaskId||rootTaskId==1){
			url="/index.php/task/getall/"+Math.ceil(Math.random()*100);
			str='	<div data-taskid="1" class="task getby_parent" id="901"  data-getway="R" ondragover="task_dragover(event)" ondrop="task_drop(event)" ondragenter="task_dragenter(event)" ondragleave="task_dragleave(event)">		<a class="expend_fold" href="###" title="展开"><i class="fa fa-folder-o"></i></a><span class="task_title task_for_drag ">所有分类任务</span>'
				+'<a class="icon_button btn_for_toolbar" href="###" title="操作面板1"><i class="fa fa-lg fa-angle-double-right"></i></a>'
				+'</div>';
			$("#alltask_view").append(str);
		}else{
			url="/index.php/tasktree/getallchild/"+rootTaskId;
		}
		var loading=layer.msg('正从服务器上加载数据，请稍候！', {icon: 16});
//		var loading = layer.load(2); //换了种风格

//
		var items;
		$.getJSON(url, 
			function(dataGet) { 
//			console.log(dataGet);
				if(dataGet.data){
//					console.log(dataGet.data);
					console.time('生成任务DOM开始');
					items=dataGet.data;
						var frag = document.createDocumentFragment();
						$.each(items,function(idx,item){ //生成所有任务，先放到任务挂装区
	//						console.log(item);//每个约5ms左右
//                            $("#904").append(new_task(item));//用在frag中挂装，而后一次性挂装到DOM，提高性能
							$(frag).append(new_task(item));
						});
						
						$("#904").append($(frag));//
						
					console.timeEnd('生成任务DOM结束');
						$("#904>div.task").hide();
                        $.each(items,function(idx,item){ //所有任务依据自己的parnet挂装
//							console.log(item);//每个需15ms左右
							$("#simple_view .task[data-taskid="+item.parent+"]").append($("#simple_view .task[data-taskid="+item.id+"]"));
							$("#alltask_view .task[data-taskid="+item.parent+"]").append($("#simple_view .task[data-taskid="+item.id+"]"));						
//							$(".task[data-taskid="+item.parent+"]").append($("#simple_view .task[data-taskid="+item.id+"]"));
						});	
						
						//根任务挂到分类任务视图下
					$("#alltask_view").append($(" .task[data-taskid="+rootTaskId+"]"));
//							
					$("#902").append($(" .task[data-simple=1]"));//将所有的临时任务挂装到临时视图区
					
					$('#btn_refresh_all i').removeClass('fa-spin');
					expend_icon_status();
					$("#alltask_view>div.task").show();
					$("#902>div.task").show();
					
					//关闭
//					layer.close(index); 
					layer.close(loading); 
				}
			}		
		);
		$('#btn_refresh_all i').addClass('fa-spin');  
}		


$(document).ready(function() {

    
    //一键取得所有活动任务并挂装
	refresh_node_and_append();
//	create_node_parents_list();
	
	
	console.log($("#parm").attr('data-rootTaskId'));
	
	$("#input_simple_task_add").focus();

});	//end of $(document).ready事件

 </script>
</head>
<body>
<div  class="page_header cl" style="width:100%;height:80px;">
<?php echo $loginbar; ?>
<div><div class="logo"><a href="/">&nbsp;<img src="/_assets/img/logo_50_80.png" style="vertical-align:bottom">&nbsp;&nbsp;<span style="color:blue;">think</span><span style="color:red;">todo.cn</span></a></div><h3>想即做 任务清单</h3></div>

	
</div>



<div id="content_area" style="float:left;width:100%;"  ondragover="dragover_content_area(event);" ondrop="drop_on_content_area(event);"><!--页面主内容区开始 -->

	
		<div data-taskid="4" class="task getby_parent area" id="904"  data-getway="R" 
		 ondrop="task_drop(event)" >
		<a class="expend_fold" href="###" title="展开"><i class="fa fa-folder-o"></i></a>
		<span class="task_title task_for_drag ">任务挂装区</span>
		<a class="icon_button btn_for_toolbar" href="###" title="操作面板4"><i class="fa fa-lg fa-angle-double-right"></i></a>
	</div>
<div id="alltask_container" class="view_container" data-visible="hide" data-step="3" data-intro="对任务进行分类组织!"  data-position='bottom' ><header><i class="fa fa-sitemap fa-rotate-270 fa-2x fa-fw" onclick="view_show_hide('alltask');" title="分类任务"></i></header>
<div id="alltask_view"  class="view_content area">
<!--
	<div data-taskid="1" class="task getby_parent" id="901"  data-getway="R" 
		ondragover="task_dragover(event)" ondrop="task_drop(event)" ondragenter="task_dragenter(event)" ondragleave="task_dragleave(event)">
		<a class="expend_fold" href="###" title="展开"><i class="fa fa-folder-o"></i></a>
		<span class="task_title task_for_drag ">所有分类任务</span>
		<a class="icon_button btn_for_toolbar" href="###" title="操作面板1"><i class="fa fa-lg fa-angle-double-right"></i></a>
        <span class="task_comment radius"><span><i class="fa fa-check btn" onclick="change_comment(event);"></i>
        <i class="fa fa-remove btn " onclick="close_comment(event);"></i></span><textarea></textarea></span>
	</div>
	-->
</div>
</div>

</div><!--页面主内容区结束 -->
<div id="task_toolbar" class="radius " style="display:none;">
<i class="fa fa-fw fa-remove btn  for_task for_search for_root for_title" style="float:right;" onclick="hide_toolbar()" title="关闭"></i>

<i class="fa fa-fw fa-refresh btn radius btn-default for_task for_root for_title" onclick="refresh_dom_child()" title="刷新" ></i>
<i class="fa fa-fw fa-sort-up btn btn-default radius for_task" onclick="upDown('up')" title="上移"></i>
<i class="fa fa-fw fa-sort-down  btn radius btn-default for_task" onclick="upDown('down')" title="下移"></i>
<i class="fa fa-fw fa-crosshairs btn radius btn-default for_search" onclick="position_task_id()" title="定位"></i>
<i class="fa fa-fw fa-eye-slash  btn radius btn-default for_simple_view_2" onclick="task_archive_to(3)" title="不关注"></i>
<i class="fa fa-fw fa-eye  btn radius btn-default for_simple_view_3" onclick="task_archive_to(2)" title="恢复关注"></i>
<i class="fa fa-fw fa-archive  btn radius btn-default for_task" onclick="task_archive()" title="归档/恢复"></i>
<i class="fa fa-fw fa-bullhorn  btn radius btn-default for_task" onclick="pub()" title="发布"></i>
<i class="fa fa-fw fa-trash btn radius btn-default for_task" onclick="del_myself()" title="删除任务"  ></i>
<br>
<i class="fa fa-fw fa-plus btn radius btn-default for_task for_root" onclick="call_add_child_input()" title="增加子任务"  ></i>
<i class="fa fa-fw fa-edit btn radius btn-default for_task" onclick="task_text_edit('title')" title="修改任务" ></i>
<i class="fa fa-fw fa-tags btn radius btn-default for_task" onclick="task_text_edit('tags')" title="标签" ></i>
<i class="fa fa-fw fa-gears btn radius btn-default for_task" onclick="task_text_edit('intags')" title="样式标签" ></i>
<i class="fa fa-fw fa-link btn radius btn-default for_task" onclick="task_text_edit('link')" title="链接" ></i>
<i class="fa fa-fw fa-share-square btn radius btn-default for_task" onclick="task_text_edit('internal_link')" title="内链" ></i>
<!--
<i class="fa fa-fw fa-anchor btn radius btn-default for_task" id="btn_anchor" onclick="set_anchor()" title="锚记" ></i>
-->
<i class="fa fa-fw fa-comment btn radius btn-default for_task " onclick="show_task_comment()" title="备注" ></i>
<i class="fa fa-fw fa-photo btn radius btn-default for_task " onclick="task_text_edit('photo')" title="图片" ></i>
<br>
<!--

<div id="text_edit_div" style="display:none;" data-action="title">
<input id="input_text_edit" class="input-text radius" type=text onkeydown='if(event.keyCode==13){edit_task_text_ok();}' value="">
<a class="btn btn-default" herf="###" onclick="edit_task_text_ok();"><i class="fa fa-check-circle-o"></i></a>
<a class="btn btn-default" herf="###" onclick="edit_task_text_cancel();"><i class="fa fa-times-circle-o"></i></a>
</div>


-->
<div class="form-inline" id="text_edit_div" style="display:none;" data-action="title">
<!--
用了bootstrap后，是否不用再写回车代码了，不然会提交两次
<input id="input_simple_task_add" class="form-control radius  "  onkeydown='if(event.keyCode==13){simple_task_add();}'  type=text>
-->
<input id="input_text_edit" class="form-control radius" type=text onkeydown='if(event.keyCode==13){edit_task_text_ok();}' value="">

<button  class="btn btn-primary "  onclick="edit_task_text_ok();"><i class="fa fa-check-circle-o"></i></button>
<button class="btn "  onclick="edit_task_text_cancel();"><i class="fa fa-times-circle-o"></i></button>
</div>


<i class="fa fa-fw fa-square icon-blank btn radius btn-default for_task for_search" title="无状态" onclick="change_stage('')"> </i>
<i class="fa fa-fw fa-question icon-question btn radius btn-default  for_task for_search" title="疑问" onclick="change_stage('question')"> </i>
<i class="fa fa-fw fa-lightbulb-o icon-think btn radius btn-default  for_task for_search" title="思路" onclick="change_stage('think')"> </i>
<i class="fa fa-fw fa-play-circle icon-doing btn radius btn-default for_task for_search " title="活动" onclick="change_stage('doing')"> </i>
<i class="fa fa-fw fa-bomb icon-urgent btn radius btn-default  for_task for_search" title="迫切" onclick="change_stage('urgent')"> </i>
<i class="fa fa-fw fa-puzzle-piece icon-hand btn radius btn-default for_task for_search" title="协作" onclick="change_stage('farm-out')"> </i>
<i class="fa fa-fw fa-pause icon-pause btn radius btn-default for_task for_search" title="挂起" onclick="change_stage('suspend')"> </i>
<i class="fa fa-fw fa-paper-plane icon-send btn radius btn-default for_task for_search" title="交差" onclick="change_stage('send')"> </i>
<i class="fa fa-fw fa-check icon-finish btn radius btn-default for_task for_search" title="完成" onclick="change_stage('finish')"> </i>
<i class="fa fa-fw fa-remove icon-giveup btn radius btn-default for_task for_search" title="放弃" onclick="change_stage('giveup')"> </i>


</div>
<div id="task_photo_show" class="radius " style="display:none;position:absolute;z-index:5;"><img></div>

<footer>
<div class="footer">
    <ul style="float:right;">
    <li><a href="###" onclick="open_intro();">我们这样理解任务</a></li>
    <li><a href=/index.php/article/get/962 target="_blank">更新日志</a></li>
        <li>(请使用chrome或IE10以上浏览器)</li>
	<li><a href="/index.php/home/prev" target="_blank">前一稳定版本</a></li>   	
    <li><a href="/index.php/home/next" target="_blank">下一测试版本</a></li>  
	<li><a href="/index.php/home/w/1" target="_blank">多工作区测试版本</a></li> 
    </ul>
</div>
</footer>
<div id="temp" style="display:none;"></div>
<div id="parm" style="display:none" 
 data-rootTaskId = "<?php echo $rootTaskId;?>" 
 data-fworkarea = ""
 ></div>
    <script type="text/javascript" src="/libs/moment.min.js"></script>
    <script src="/libs/mousetrap.min.js"></script>
    <script type="text/javascript" src="/libs/jquery.scrollTo-2.1.2/jquery.scrollTo.js"></script> 
    <script src="/_assets/js/app/for_save_search.js"></script>
    <script src="/_assets/js/app/keep_alive.js"></script>
    <script src="/_assets/js/app/task_search.js"></script>
    <script src="/_assets/js/app/mycalendar.js"></script>
    <script src="/_assets/js/app/mycalendar_drag.js"></script>
    <script src="/_assets/js/app/expend_fold2.js"></script>
    <script src="/_assets/js/app/toolbar2.js"></script>
    <script src="/_assets/js/app/taskset.js"></script>
    <script src="/_assets/js/app/task_drag4.js"></script>
    <script src="/_assets/js/app/keyboard.js"></script>
    <script src="/_assets/js/app/viewshow.js"></script>
    <script src="/_assets/js/app/createtask.js"></script>
    <script src="/_assets/js/app/loadtask4home295.js"></script>
    <script src="/_assets/js/app/task_dom_opt.js"></script>
	<script src="/_assets/js/app/recent.js"></script>
    <script src="/_assets/js/app/history_task.js"></script>
    <script src="/_assets/js/app/team_task.js"></script>
    <script src="/_assets/js/app/cancel2.js"></script>
    <script type="text/javascript" src="/libs/introjs/intro.js"></script>
    <script src="/_assets/js/app/intro_help.js"></script>
</body>
</html>